#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int term = 0;
	int sum = 0;
	int a = 0;
	scanf("%d", &a);
	int n = 5;
	while (n)
	{
		term += a;
		a *= 10;
		sum += term;
		n--;

	}
	printf("%d", sum);
	return 0;
}